<?php

namespace Gateway;

use Gateway\CommUtil;

/**
 * 一砂云余额查询,参考文档 : https://esandinfo.yuque.com/yv6e1k/aa4qsg/la1w7otq7vg00i1g
 */
class EsBalanceRequest
{
    /**
     * 请求action
     */
    public static $act = "comms/edis/query_balance_info";
    /**
     * 请求业务ID（需确保唯一）
     */
    public $transId;

    public function __construct($transId) {
        if (empty($transId)) {
            $this->transId = CommUtil::getTimeUUID();
        } else {
            $this->transId = $transId;
        }
    }

    /**
     * 把对象序列化为JSON字符串
     * @return false|string
     */
    public function toJsonStr() {
        $jsonStr = json_encode($this);

        return $jsonStr;
    }
}